<?php

namespace App\Models;

class GoodsCommon extends Model
{
    protected $table = 'yf_goods_common';
    protected $primaryKey = 'common_id';
    public $timestamps = false;
    protected $guarded = ['common_id'];
    protected $casts = ['goods_id' => 'array'];

    public static function findByIds(array $ids)
    {
        return self::whereIn('common_id', $ids)->get();
    }

    public function getGoodsId()
    {
        return current(current($this->goods_id));
    }
}
